<template>
    <div class="person">
        <h2>当前求和为：{{ sum }}</h2>
        <button @click="add">点我+1</button>
    </div>
</template>

<script>
export default {
    //关掉下一行的语法检查
    //eslint-disable-next-line
  name: 'Person',
  //数据
  data() {
        return {
            sum: 0
        }
   },
    //方法
  methods: {
        add() {
            this.sum++
        }
  }
}

</script>

<style scoped>
.person{
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
}
</style>
